import React, { Component } from 'react'

export default class Parent extends Component {
  render() {
    return (
      <div>
        <h1>我是Parent组件</h1>
        <Child render={(name)=><Child2 name={name}/>}/>
        {/* <Child>Hello</Child> */}
      </div>
    )
  }
}
class Child extends Component {
  render() {
    return (
        <div>
            <h1>Child组件</h1>
            {this.props.render('Fong')}
            {/* {this.props.children} */}
        </div>
    )
  }
}
class Child2 extends Component {
    render() {
      return (
        <div>
            <h2>我是Child2组件</h2>
            <h2>接收到的数据为：{this.props.name}</h2>
        </div>

      )
    }
  }